<template>
	<view class="app-bookdetail">
		<view class="app-bookdetail__status e-flex-y-center e-p-l-50">
			<text class="c-333 w-600 e-font-40" v-if="info.status === 1">审核中</text>
			<text class="c-333 w-600 e-font-40" v-else-if="info.status === 3">审核失败</text>
			<text class="c-333 w-600 e-font-40" v-else-if="info.status === 2">已完成</text>
		</view>
		<view class="e-p-l-20 e-p-r-20">
			<view class="bg-white e-radius-20 e-p-20 e-flex e-m-b-20">
			<image :src="$staticPath('black-cc.png')" mode="" class="img-200"></image>
				<view class="e-p-l-20  e-flex-1">
					<view class="e-flex-1 e-flex app-bookdetail__title">
						<view class="c-333 e-font-28 e-flex-1 e-p-r-20">
							黑曜石手链
						</view>
						<view class="e-font-26" style="color: #808080;">
							x{{info.deliveryNum}}
						</view>
					</view>
					<view class="e-flex-end">
						<text style="color: #808080;" class="e-font-28">提货数量：{{info.deliveryNum}}串</text>
					</view>
				</view>
			</view>
			
			<view class="bg-white e-radius-20 e-m-b-20" v-if="info.status === 3">
				<view class="e-p-t-30 e-p-l-20 e-p-b-30 e-p-r-20 app-bookdetail__box">
					<text class="c-333 e-font-28 w-600">{{info.rejectReason}}</text>
				</view>
				<view class="e-p-t-30 e-p-l-20 e-p-b-30">
					当前深文艺术账号无法提货，请更改账号
				</view>
			</view>
			
			<view class="bg-white e-radius-20 e-m-b-20">
				<view class="e-p-t-30 e-p-l-20 e-p-b-30 app-bookdetail__box">
					<text class="c-333 e-font-28 w-600">提货信息</text>
				</view>
				<view class="e-p-t-30 e-p-l-20 e-p-b-30 e-p-r-20">
					<view class="e-flex-y-center e-m-b-20">
						<view class="e-flex-1 e-font-26" style="color: #808080;">
							提货编号
						</view>
						<view class="e-flex">
							<text class="c-333 e-font-26">{{info.serialNo}}</text>
							<image :src="$staticPath('copy.png')" mode="" class="img-32 e-m-l-20" @tap="$copy(info.serialNo)"></image>
						</view>
					</view>
					<view class="e-flex-y-center e-m-b-20">
						<view class="e-flex-1 e-font-26" style="color: #808080;">
							提货账号
						</view>
						<view class="e-flex">
							<text class="c-333 e-font-26">{{info.swAccount}}</text>
						</view>
					</view>
					<view class="e-flex-y-center e-m-b-20">
						<view class="e-flex-1 e-font-26" style="color: #808080;">
							申请时间
						</view>
						<view class="e-flex">
							<text class="c-333 e-font-26">{{info.createTime}}</text>
						</view>
					</view>
					<view class="e-flex-y-center e-m-b-20" v-if="info.status === 2 || info.status === 3">
						<view class="e-flex-1 e-font-26" style="color: #808080;">
							<text v-if="info.status === 3">驳回时间</text>
							<text v-else>通过时间</text>
						</view>
						<view class="e-flex">
							<text class="c-333 e-font-26">{{info.reviewTime}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="app-bookdetail__footer" v-if="info.status === 3">
			<view class="app-bookdetail__footer--btn e-flex-xy-center"  @tap="$goRedirectTo('/pages/book/index',{index:1})">
				<text class="e-font-30">重新提货</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {getDeliveryDetail} from '@/common/request/api'
	export default {
		data() {
			return {
				info:{}
			}
		},
		onLoad(opt) {
			if (opt.id) {
				uni.showLoading()
				getDeliveryDetail(opt.id).then(res=>{
					this.info = res.data
				}).finally(() => {
					uni.hideLoading()
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.img-200{
		width: 200rpx;
		height: 200rpx;
		border-radius: 20rpx;
	}
	.e-flex-column {
		display: flex;
		flex-direction: column;
	}
	.e-flex-end {
		display: flex;
		align-items: flex-end;
	}
	@include appBem_b(bookdetail) {
		background: #F8F8F8;
		padding-bottom: 120rpx;
		@include appBem_e(status) {
			width: 100vw;
			height: 130rpx;
		}
		@include appBem_e(title) {
			margin-bottom: 100rpx;
		}
		@include appBem_e(box) {
			height: 100rpx;
			box-shadow: inset 0px -1rpx 0px 0px #F3F3F3;
		}
		@include appBem_e(footer) {
			width: 100vw;
			height: 120rpx;
			display: flex;
			align-items: flex-end;
			justify-content: flex-end;
			background: #fff;
			position: fixed;
			bottom: 0;
			left: 0;
			z-index: 999;
			padding-bottom: 20rpx;
			padding-right: 20rpx;
			@include appBem_m(btn) {
				width: 172rpx;
				height: 70rpx;
				border-radius: 36rpx;
				border: 1rpx solid #B4B4B4;
				color: #353535;
			}
		}
	}
</style>